package com.ruoyi.recycleshop.config;

import org.springframework.boot.task.TaskExecutorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;


@Configuration

public class ThreadConfig {

    @Bean(name = "couponThreadPool")
    public ThreadPoolTaskExecutor threadPoolExecutor(TaskExecutorBuilder builder) {
        ThreadPoolTaskExecutor taskExecutor = builder.build();
        taskExecutor.setThreadNamePrefix("interface-handle-thread-");
        return taskExecutor;
    }
}
